package com.ktjy.test2;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class AccessUserMethod {
    public static void main(String[] args) {
        try {
            Class clz = Class.forName("com.ktjy.mapper.User");
            Object obj = clz.newInstance();
            Method getStar = clz.getDeclaredMethod("getStar",  null);
            System.out.println("getStar:"+getStar.invoke(obj, null));

            Method getsilebtMethod=clz.getDeclaredMethod("silebtMethod", null);
            getsilebtMethod.setAccessible(true);
            getsilebtMethod.invoke(obj, null);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}